﻿package com.wolf.roboot;

import java.util.Map;

import com.alibaba.fastjson.JSONObject;
import com.wolf.util.PostServer;
import com.wolf.wztoyy.Test6;

public enum RobootMain {
	
	Instance;
	
	public static RobootMain getInstance(){
		return Instance;
	}
	
	public void runAes(String cmd){
		
		String secret = "";
		
		String apiKey = "";
		
		
		String timestamp = String.valueOf(System.currentTimeMillis());	
		
		JSONObject json = new JSONObject();
		json.put("key", apiKey);
		json.put("timestamp", timestamp);
		System.out.println("准备推送的文字--->"+cmd);
		json.put("info", cmd);
		String result = PostServer.SendPost(json.toString(), "http://www.tuling123.com/openapi/api");
		Map<String,String> map = json.parseObject(result, Map.class);
		String data = map.get("text");
		System.out.println("机器人返回---->"+data);
		Test6.getInstance().synthesis(data);
	}

}
